package com.itheima.health.controller;

import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import com.itheima.health.service.ValidateCodeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("mobile/validateCode")
@Slf4j
public class ValidateCodeController {

    @DubboReference
    private ValidateCodeService validateCodeService;

    /**
     * @Author: 10263
     * @Date: 18:47 2021/3/11
     * @Parms [type, telephone]
     * @ReturnType: com.itheima.health.entity.Result
     * @Description: 发送短信验证码
    */
    @PostMapping("send")
    public Result send(String type,String telephone){
        validateCodeService.sendValidateCode(type,telephone);
        return new Result(true,MessageConst.SEND_VALIDATECODE_SUCCESS);
    }

}
